Changed UUID / Xen handle formatting to be compatible with the OSF DCE UUIDs.
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Tue, 20 Dec 2005 17:16:15 +0000 (17:16 +0000)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Tue, 20 Dec 2005 17:16:15 +0000 (17:16 +0000)
Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/xend/uuid.py
xen/common/keyhandler.c

index 2bf514c67d724e9949ec8f8555cd760516eb54c0..401540bc6e372f2b8c76f1a587b5e3cd3505b497 100644 (file)
 #============================================================================
 
 
-"""Universal(ly) Unique Identifiers (UUIDs).
-"""
+"""Universal Unique Identifiers (UUIDs).  By default, UUIDs generated here are
+purely random, with no internal structure.  However, they are the same size,
+and are formatted by the same conventions, as the UUIDs in the Open Software
+Foundation's Distributed Computing Environment (OSF DCE).  This allows Xend to
+be used with UUIDs generated as per the DCE specification, should that be
+required.  These UUIDs are also, by no coincidence, the same size as the
+'handle' stored by the Xen hypervisor along with the domain structure."""
 
 
 import commands
@@ -54,7 +59,8 @@ def create():
 
 
 def toString(u):
-    return "-".join(["%02x" * 4] * 4) % tuple(u)
+    return "-".join(["%02x" * 4, "%02x" * 2, "%02x" * 2, "%02x" * 2,
+                     "%02x" * 6]) % tuple(u)
 
 def fromString(s):
     s = s.replace('-', '')
index acbfd094bc2f2eb397c39b0f79ebf38385c42fee..7f569d99fbeb0657ab6da3d2ae0aa6980958781f 100644 (file)
@@ -112,8 +112,11 @@ static void do_task_queues(unsigned char key)
         printk("Xen: DOM %u, flags=%lx refcnt=%d nr_pages=%d "
                "xenheap_pages=%d\n", d->domain_id, d->domain_flags,
                atomic_read(&d->refcnt), d->tot_pages, d->xenheap_pages);
-        printk("     handle=%02x%02x%02x%02x-%02x%02x%02x%02x-"
-               "%02x%02x%02x%02x-%02x%02x%02x%02x\n",
+        /* The handle is printed according to the OSF DCE UUID spec., even
+           though it is not necessarily such a thing, for ease of use when it
+           _is_ one of those. */
+        printk("     handle=%02x%02x%02x%02x-%02x%02x-%02x%02x-"
+               "%02x%02x-%02x%02x%02x%02x%02x%02x\n",
                d->handle[ 0], d->handle[ 1], d->handle[ 2], d->handle[ 3],
                d->handle[ 4], d->handle[ 5], d->handle[ 6], d->handle[ 7],
                d->handle[ 8], d->handle[ 9], d->handle[10], d->handle[11],